<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<button onclick="btn()">点击</button>
<script>
  let flag = true;
  function btn (){
    if (!flag) {
      console.log('过滤掉')
      return
    }
    flag = false;
    setTimeout(function () {
      console.log('防抖22222222')
      flag = true
    }, 500)
  }
</script>
</body>
</html>